package cn.gailvlun.gll.chatkit.message;

import java.util.ArrayList;
import java.util.List;

import cn.gailvlun.gll.chatkit.R;
import cn.gailvlun.gll.chatlib.message.MessageType;



public class MessageMgr {
    private static MessageMgr INSTANCE = null;
    public static MessageMgr getInstance() {
        if (INSTANCE == null) {
            synchronized (MessageMgr.class) {
                if (INSTANCE == null) {
                    INSTANCE = new MessageMgr();
                }
            }
        }
        return INSTANCE;
    }
    private MessageMgr() {
        addMessageType(MessageType.text, R.layout.item_message_text);
        addMessageType(MessageType.image, R.layout.item_message_image);
        addMessageType(MessageType.walkieTalkie, R.layout.item_message_voice);

        addMessageType(MessageType.checkIn, R.layout.item_message_check_in);
        addMessageType(MessageType.invite, R.layout.item_message_icon_invite);

        addMessageType(MessageType.initInfo, R.layout.item_message_init_info);
        addMessageType(MessageType.sticker, R.layout.item_message_sticker);
    }

    public void addMessageType(MessageType type, Integer layoutId) {
        mClassList.add(type);
        mLayoutList.add(layoutId);
    }

    private List<MessageType> mClassList = new ArrayList<>();
    private List<Integer> mLayoutList = new ArrayList<>();

    public List<MessageType> getClassList() {
        return mClassList;
    }

    public List<Integer> getLayoutList() {
        return mLayoutList;
    }
}